package com.myk.game.gobangchess.constants;

/**
 * 聊天等级
 */
public enum ChatLevel {
    PRESET(0, "预设"),
    PAY(1, "付费"),
    FREE(2, "自由"),
    BAN(9, "禁言");
    private int level;
    private String desc;

    ChatLevel(int level, String desc) {
        this.level = level;
        this.desc = desc;
    }

    public static String getDescByLevel(int level) {
        for (ChatLevel chatLevel : ChatLevel.values()) {
            if (chatLevel.getLevel() == level) {
                return chatLevel.getDesc();
            }
        }
        return PRESET.getDesc();
    }

    public int getLevel() {
        return level;
    }

    public String getDesc() {
        return desc;
    }
}
